% Z = ELEMENTPOW(X,N) Evaluate x^n
%
%   Inputs:
%
%       x       GF element
%       n       Power.  
%
%
%   Outputs:
%
%       Z       The quantity x^n

function z = elementPow(x,n)
    global m

    % if x is zero, return zero
    if isZero(x)
        z = -1;
        return;
    end

    % if x is 1, return 1
    if x == 0
        z = 0;
        return;
    end

    z = elementReduce(x * n);

end

